DEFINITION FOR C MODULE ConUnit ;

FROM SYSTEM	IMPORT ADDRESS, SHORTSET ;
FROM Console	IMPORT M_LNM ;
FROM Exec	IMPORT MsgPort ;
FROM InputEvent IMPORT IECLASS_MAX ;
FROM KeyMap	IMPORT KeyMap ;
FROM Intuition	IMPORT WindowPtr ;
FROM Graphics	IMPORT TextFontPtr ;

CONST
(* ----	console unit numbers for OpenDevice() *)
  CONU_LIBRARY	= -1 ;	(* no unit, just fill in IO_DEVICE field *)
  CONU_STANDARD	=  0 ;	(* standard unmapped console		 *)

(* ---- New unit numbers for OpenDevice() - (V36) *)

  CONU_CHARMAP = 1 ; (* bind character map to console	      *)
  CONU_SNIPMAP = 3 ; (* bind character map w/ snip to console *)

(* ---- New flag defines for OpenDevice() - (V37) *)

  CONFLAG_DEFAULT = 0 ;
  CONFLAG_NODRAW_ON_NEWSIZE = 1 ;

  PMB_ASM = (M_LNM+1) ;		(* internal storage bit for AS flag *)
  PMB_AWM = (PMB_ASM+1) ;	(* internal storage bit for AW flag *)
  MAXTABS = 80 ;


TYPE
  ConUnit = RECORD
    cu_MP	  : MsgPort ;
    (* ---- read only variables *)
    cu_Window	  : WindowPtr ;	(* intuition window bound to this unit *)

    cu_XCP	  : INTEGER ; (* character position *)
    cu_YCP	  : INTEGER ;
    cu_XMax	  : INTEGER ; (* max character position *)
    cu_YMax	  : INTEGER ;
    cu_XRSize	  : INTEGER ; (* character raster size *)
    cu_YRSize	  : INTEGER ;
    cu_XROrigin   : INTEGER ; (* raster origin *)
    cu_YROrigin   : INTEGER ;
    cu_XRExtant   : INTEGER ; (* raster maxima *)
    cu_YRExtant   : INTEGER ;
    cu_XMinShrink : INTEGER ; (* smallest area intact from resize process *)
    cu_YMinShrink : INTEGER ;
    cu_XCCP	  : INTEGER ; (* cursor position *)
    cu_YCCP	  : INTEGER ;

    (* ---- read/write variables (writes must must be protected) *)
    (* ---- storage for AskKeyMap and SetKeyMap *)

    cu_KeyMapStruct : KeyMap ;

    (* ---- tab stops *)

    cu_TabStops   : ARRAY [0..MAXTABS-1] OF CARDINAL ;
    		    (* 0 at start, 0FFFF at end of list *)

    (* ---- console rastport attributes *)
    cu_Mask       : SHORTINT ;
    cu_FgPen      : SHORTINT ;
    cu_BgPen      : SHORTINT ;
    cu_AOLPen     : SHORTINT ;
    cu_DrawMode   : SHORTSET ;
    cu_Obsolete1  : SHORTINT ; (* was cu_AreaPtSz -- not used in V36 *)
    cu_Obsolete2  : ADDRESS  ; (* was cu_AreaPtrn -- not used in V36 *)
    cu_Minterms   : ARRAY [0..7] OF SHORTINT ;	(* console minterms *)
    cu_Font	  : TextFontPtr ;
    cu_AlgoStyle  : SHORTINT ;
    cu_TxFlags    : SHORTSET ;
    cu_TxHeight   : CARDINAL ;
    cu_TxWidth    : CARDINAL ;
    cu_TxBaseline : CARDINAL ;
    cu_TxSpacing  : CARDINAL ;

    (* ---- console MODES and RAW EVENTS switches *)
    cu_Modes	  : ARRAY [0..((PMB_AWM+7)/8)-1] OF SHORTSET ;(* 1bit per mode*)
    cu_RawEvents  : ARRAY [0..((IECLASS_MAX+8)/8)-1] OF SHORTCARD  ;
  END ;

END ConUnit.
